package com.hax2max.model;

import java.util.Date;
import java.util.Iterator;
import java.util.NoSuchElementException;

import com.hax2max.control.DataHandler;


public class Profile {
	public String email;
	public String username;
	public String password;
	public String fname;
	public String lname;
	public String mobile;
	public String phoneNumber;
	public String homepage;

	public Date lastUpdated;

	//lista av statusar

	public Status[] statuses;

	//lista av footprints

	public FootPrint[] footprints; 

	//lista av externalData

	public ExternalData[] externalData;

	public Profile() {

	}
	public Profile(String email,
			String username,
			//String password,
			String fname,
			String lname,
			String mobile,
			String phoneNumber,
			String homepage
	){
		this.email = email;
		this.username = username;
		//this.password = password;
		this.fname = fname;
		this.lname = lname;
		this.mobile = mobile;
		this.phoneNumber= phoneNumber;
		this.homepage = homepage;

	}
	public Profile(Profile p){
		this.email = p.email;
		this.username = p.username;
		this.fname = p.fname;
		this.lname = p.lname;
		this.mobile = p.mobile;
		this.phoneNumber= p.phoneNumber;
		this.homepage = p.homepage;
	}

	public static final String tableName = "Profiles"; 
	public static final String usernameColumn = "username";
	public static final String emailColumn = "email";
	public static final String fnameColumn = "fname";
	public static final String lnameColumn = "lname";
	public static final String mobileColumn = "mobile";
	public static final String homepageColumn = "homepage";
	public static final String lastupdatedColumn = "lastupdate";
	public static final String passwordColumn = "password";
	public static final String _idColumn = "username as _id"; // needed for cursor adapters

	public static final String[] AllColumns = { usernameColumn,passwordColumn, emailColumn,fnameColumn,
		lnameColumn,mobileColumn, homepageColumn, lastupdatedColumn };
	
	public static final String[] AllColumnsFriend = {usernameColumn, emailColumn,fnameColumn,
		lnameColumn,mobileColumn, homepageColumn, lastupdatedColumn, _idColumn};

	
	public String toString()
	{
		return (fname==null?"":fname)+";"+(lname==null?"":lname)+";"+(email==null?"":email)+";"+(username==null?"":username)+";"+(mobile==null?"":mobile)+";"+(statuses==null ?"1" : statuses[0].statusId)+";"+(password==null?"":"")+";"+(phoneNumber==null?"":phoneNumber)+";"+(homepage==null?"":homepage) +";"+(lastUpdated==null? "":lastUpdated.getTime()); 
	}
	
}
